<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" dir="ltr">
#set($title="${category.name}_#foreach($cat in $category.higherLevelList)$cat.name_#end")
#set($description=$category.description)
<head>
#headTag($title $description)
<script type="text/javascript" src="$url.base/static/xheditor/xheditor-1.1.8-zh-cn.min.js"></script>
<script type="text/javascript" src="$url.base/static/xheditor/xheditor_plugins/ubb.min.js"></script>
</head>
<body>
<div id="page">
#parse("default/_header.htm")
<div id="middle">
<div id="main_wrap">
	<div id="main">
		#topbar($category 'index')
		<div class="topic_list">
		#topicList($topicInfoList)
		</div>
		#set($dynamicInfo=$category.dynamicInfo(10))
		共有主题数<span class="high-light">$dynamicInfo.subjectCount</span>个，贴子数<span class="high-light">$dynamicInfo.postCount</span>篇；
		今天帖子数<span class="high-light">$dynamicInfo.todayPostCount</span>篇，昨天帖子数<span class="high-light">$dynamicInfo.yesterdayPostCount</span>篇
		#pagination($pagination)
		<a id="new" name="new"></a>
		<div class="topic_form">
			<form id="subjectForm" action="$url.base/topic" method="post">
			<table>
				<tr>
					<th>标题:</th>
					<td valign="top">
					<input name="title" type="text" style="width:425px;height:18px;font-size:14px;padding-top:4px;padding-left:2px;"/>
					#set($children=$category.children)
					#if($children.size()>0)
						<select class="select-category" autocomplete="off">
							<option selected="selected" value="0">...</option>
							#foreach($child in $children)
							<option value="$child.id">$child.name</option>
							#end
						</select>
					#else
						<select class="select-category" style="display:none">
							<option value="$category.id">$category.name</option>
						</select>
					#end
					</td>
					<td>
					</td>
				</tr>
				<tr>
					<th>内容:</th>
					<td>
					<div class="editor">
						<textarea id="topic_content" rows="10" cols="40" style="width:570px;height:250px;" name="content"></textarea>
					</div>
					</td>
					<td> </td>
				</tr>
				<tr>
					<td> </td>
					<td>
						<input style="margin-top:25px; padding:0 10px;" type="submit" value="发　表"></input>
					</td>
					<td> </td>
				</tr>
			</table>
			</form>
		</div>
	</div>
</div>
#parse("default/_sidebar.htm")
</div>
<div class="clear"></div>
</div>
#parse("default/_footer.htm")
<!-- 
<script type="text/javascript">
$('input[name=title]').attr("autocomplete","off");
if($('#topic_content').length > 0){
	KE.show({
		id : 'topic_content',
		urlType:'domain',
		items: ['fullscreen', 'undo', 'redo', 'justifyleft', 'justifycenter', 'justifyright',
	'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'hr', 'table', 'link', 'unlink', '-',
	'fontname', 'fontsize', 'textcolor', 'bgcolor', 'bold',
	'italic', 'underline', 'strikethrough', 'removeformat', 'flash',
	'media', 'image', 'emoticons'],
		resizeMode:0
	});
}
</script>
 -->
<script type="text/javascript">
$('input[name=title]').attr("autocomplete","off");
var editor;
$(pageInit);
function pageInit()
{
	editor= $('#topic_content').xheditor({
		skin:'nostyle',
		tools:'Fullscreen,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,Removeformat,|,Align,Img,Emot,Link,Unlink,SelectAll,Pastetext,Source',
		html5Upload:false,
		upImgUrl:"$url.base/xheditor/upload",
		upImgExt:"jpg,jpeg,gif,png",
		showBlocktag:false,
		forcePtag:false,
		beforeSetSource:ubb2html,
		beforeGetSource:html2ubb,
		emotMark:true,
		shortcuts:{'ctrl+enter':submitForm}
	});
}
function submitForm(){$('#subjectForm').submit();}
</script>
</body>
</html>